// JavaScript Document
var func = [];
func[0] = 'bold';
func[1] = 'italic';
func[2] = 'underline';
func[3] = 'copy';
func[4] = 'cut';
func[5] = 'paste';
function init_editor()
{
	document.write("<div class='editor_container'><div class='editor_toolbar'>");
	for(i=5; i>-1; i--)
	{
		document.write("<a href='#' onclick=\"eFunc('"+func[i]+"')\"><img src='../scripts/editor_buttons/"+func[i]+".png'></img></a>")
	}
	document.write("<a onclick=\"editor_output_html()\">Output</a></div>");
	document.write("<iframe id='editor' class='editor'></iframe></div>");
	editor.document.designMode = 'on';
}

function eFunc(func)
{
	editor.document.execCommand(func, false, null);
}

function editor_output_html()
{
	editor_html = editor.document.body.innerHTML;
	alert(editor_html);
}